package com.lixw.jdbc.util;

import com.lixw.jdbc.core.transaction.SimpleTransactionManager;

import java.sql.Connection;
import java.sql.PreparedStatement;
import java.sql.SQLException;
import java.sql.Statement;

/**
 * @ClassName: DbUtils
 * @Description:
 * @Author: xuweiLi
 * @Create: 2025/5/30 16:48
 **/
public final class DbUtils {

    public static PreparedStatement preparedStatement(String sql,int... options) throws SQLException {
        // 优先使用事务管理器的连接
        Connection conn = SimpleTransactionManager.getConnection();
        return conn.prepareStatement(sql, options);
    }
}